// writer.c
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

int main() {
    int fd;
    char * my_fifo = "/tmp/my_fifo";

    /* 打开FIFO进行写入 */
    fd = open(my_fifo, O_WRONLY);

    /* 写入数据 */
    char msg[] = "你好，我是写入进程!";
    write(fd, msg, strlen(msg)+1);

    /* 关闭FIFO */
    close(fd);

    return 0;
}
